import { HumanMessage, AIMessage } from "@langchain/core/messages";
import { ChatMessageHistory } from "langchain/memory";

export const useMemory =async () => {
    const history = new ChatMessageHistory();
    history.addMessages([new HumanMessage("你好，我是小明"), new AIMessage("你好小明，你需要什么帮助吗")]);
    const messages = await history.getMessages();
    console.log(messages);
}

useMemory();